<%--
  Created by IntelliJ IDEA.
  User: 31307
  Date: 2025/3/12
  Time: 19:49
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登陆页面</title>
    <style>
        /*样式*/
        table{
            width: 300px;
            border: 1px solid #000;
            border-collapse: collapse;
            /*水平居中和离上边缘*/
            margin: auto;
            margin-top: 250px;

        }
        td{
            border: 1px solid #000;
            /* 边距 */
            padding: 3px;
        }
        ._title{
            /* 字体- */
            font-size: 25px;
            background-color: aliceblue;
        }

    </style>
</head>
<%!
    String username = "";
%>
<body>
<%
    //读取cookies
    Cookie[] cookies = request.getCookies();
    for (Cookie cookie : cookies){
        if (cookie.getName().equals("name")){
            username = cookie.getValue();
        }
    }
%>
<form method="post" action="/shiyan1/login">
<table>

    <tr>
        <td colspan="2" class="_title" align="middle">
            登录
        </td>
    </tr>

    <tr>
        <td align="middle" >账号：</td>
        <td><input type="text" name="username" value="<%=username%>"/></td>
    </tr>

    <tr>
        <td align="middle">密码：</td>
        <td><input type="password" name="userpassword"/></td>
    </tr>

    <tr>
        <td colspan ="2" align="middle">
            <input type="checkbox">一个月免登录
        </td>
    </tr>

    <tr>
        <td colspan="2" align="middle">
            <input type="submit" value="登陆">
            <input type="reset" value="取消">
        </td>

    </tr>

</table></form>
</body>
</html>